/**
 * 右键菜单
 */
import React from 'react';
import { Menu } from 'antd';
import styles from './index.less';

export default class extends React.Component {
  static defaultProps = {
    menuList: [], //菜单列表
    onChange: () => {}, //点击事件
  };
  render() {
    const { menuList } = this.props;
    return (
      <Menu
        className={styles.menu}
        selectable={false}
        onClick={v => {
          this.props.onChange(v);
        }}
      >
        {menuList.map(item => {
          return <Menu.Item key={item.key}>{item.title}</Menu.Item>;
        })}
      </Menu>
    );
  }
}
